package com.sbm.merge.设计模式.decorator;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MessageManagerDecoratorConfig {



    @Bean
    public BasicMessgeSenderDecorator encryptedMessageSenderDecorator(MessageManager messageManager) {
        return new EncryptedMessageSenderDecorator(messageManager);
    }


    @Bean
    public BasicMessgeSenderDecorator compressedMessageSenderDecorator(BasicMessgeSenderDecorator encryptedMessageSenderDecorator) {
        return new CompressedMessageSenderDecorator(encryptedMessageSenderDecorator);
    }
}
